package com.suma.platform.core.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.nfsq.platform.utils.bean.ResultBean;
import com.suma.platform.core.service.SeckillService;

/**
 * @author suma
 * @date 2018/2/12 下午2:19
 */
@RestController
public class SeckillApi {

	@Autowired
	SeckillService seckillService;

	@RequestMapping(value = "/getSeckillList", method = { RequestMethod.GET, RequestMethod.POST })
	public ResultBean getSeckillList() {
		return new ResultBean<>(seckillService.getSeckillList());
	}

	@RequestMapping(value = "/getById", method = { RequestMethod.GET, RequestMethod.POST })
	public ResultBean getById(long seckillId) {
		return new ResultBean<>(seckillService.getById(seckillId));
	}
}
